use std::collections::HashMap;
use std::io;
fn main() {
    let s = String::from("Iterators also provide a series of adapter methods for performing common threads to sequences. Among the adapters are functional favorites like map, fold, skip and take. Of particular interest to collections is the rev adapter, that reverses any iterator that supports this operation. Most collections provide reversible iterators as the way to iterate over them in reverse order.");
    let len=s.len();
    let mut mp=HashMap::new();
    for c in s.chars(){
        //println!("value:{}",c);
        let count = mp.entry(c).or_insert(0);
        *count += 1;
        //if let Some(i) = mp.get(c) {
            //  println!("tr {:?}", tr);
              //i+1;
        //  }
    }
    println!("{:#?}",mp);
    println!("Please input your char.");
    let mut c=String::new();
    io::stdin().read_line(&mut c).expect("Read fail");
    let mut ch:char=' ';
    for k in c[0..1].chars(){
        ch=k;
    } 
    //let u=c.chars().nth(0) as u8;
    //let cc=char::from(u);
    if let Some(i) = mp.get(&ch) {
              println!("i {:?}", i);
              println!("i==1-->{}",*i==1);
          }
}
